/*
 * Collection.java
 *
 * Created on 23 de septiembre de 2005, 20:19
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package fmap.model;

import java.util.Vector;
import javax.swing.ImageIcon;
/**
 *
 * @author javi
 */
public class Collection
{
    MapF[] vMapF;
    String name;
    String name2;
    String desc;
    int idCollection;
    
    
    /**
     * Creates a new instance of Collection
     */
    public Collection ()
    {
    }

    
    public Collection ( String _name, String _desc )
    {
        name            = _name;
        name2           = _name;
        desc            = _desc;
    }
    
    public Collection (int _idCollection, String _name, String _desc)
    {
        idCollection    = _idCollection;
        name            = _name;
        name2           = _name;
        desc            = _desc;
    }
    
    public Collection (int _idCollection, String _name, String _desc, MapF[] _vMapF)
    {
        idCollection    = _idCollection;
        name            = _name;
        desc            = _desc;
        vMapF           = _vMapF;
    }
    
    public String toString ()
    {
        return name;
    }
    
    public void setMapF ( MapF[] _vMapF )
    {
        vMapF = _vMapF;
    }
    
    /**
     * Recibe un vector del modelo fMap y lo transforma en un array
     */
    public void setVMapF ( Vector _vMapF )
    {
        MapF[] __vMapF = new MapF[ _vMapF.size () ];
        for(int i=0; i < _vMapF.size (); i++)
        {
            __vMapF[i] = (MapF)_vMapF.get (i);
        }
        
        setMapF ( __vMapF );
    }
    
    
    public MapF[] getMapF ()
    {
        return vMapF;
    }
    
    /**
     * Transforma el array de mapF y lo devuelve
     */
    public Vector getVMapF ()
    {
        Vector _vMapF = new Vector ();
        if( vMapF != null )
        {
            for(int i=0; i<vMapF.length; i++)
            {
                _vMapF.add (vMapF[i]);
            }
        }
        return _vMapF;
    }


    public int getId ()
    {
        return idCollection;
    }
    
    public String getName ()
    {
        return name;
    }

    public String getName2 ()
    {
        return name2;
    }

    public void setName ( String _name )
    {
        name = _name;
    }
    
    public void setName2 ( String _name2 )
    {
        name2 = _name2;
    }
    
    public String getDesc()
    {
        return desc;
    }
    
    public void setDesc( String _desc )
    {
        desc = _desc;
    }

    public ImageIcon getImageTree()
    {
        return new ImageIcon ( getClass().getResource("/fmap/img/coleccion_tree.png") );
    }

}
